ja2v113hamfandomcom-20200214-history
Progress Controlled Roaming Militia
Many of HAM's various features involve the training and application of Mobile Militia. But perhaps the most important feature is the ability to control where and when Mobile Militia can move. History Mobile Militia is one of the oldest features in JA2 1.13. It was written by Kaiden. Mobile Militia are groups of armed locals, trained by the player, which move about the map. They seek enemies on their own, assist Mercenaries in combat, and generally provide better control of your liberated wilderness sectors. They serve as a complement to your "normal" Militia Garrisons, your "static defense" in the Major Cities. Mobile Militia move on their own - they pick the best direction to move based on a simple calculation, and try to move there. You cannot directly control their movement. When they were first added to the game, Mobile Militia were allowed to move anywhere in the countryside. If you trained a group at one end of the country, that group could potentially roam all the way to Meduna! This presented a serious problem, because if enough Mobile Militia were trained, they could easily clear out the entire strategic map - everything except cities, where they are not allowed to go. In great numbers, they would practically win most of the game on their own, without any help from the player or his mercenaries! This issue caused many players to completely forgo the training of Mobiles, as it made the game far too easy. Mobile Militia Static Restrictions Fortunately, Kaiden also created a file called RestrictedRoamingMilitia.XML. This file controls where Militia can and cannot go. In fact, the file contains a list of all sectors where Mobile Militia are NOT allowed to travel. RestrictedRoamingMilitia.XML could be edited by hand (using Notepad), and so a player can decide for themselves which sectors are visitable by Mobile Militia and which are not. The "default" file that comes with JA2 1.13 solves two major problems with Mobile Militia: #By restricting access to distant corners of the map, Militia are restricted from going there. This means that Mobile Militia instead roam the more important sectors, where they are most needed - the perimeters of Major Cities. Instead of randomly looking for enemy patrols in areas of no strategic significance, they help City Garrisons maintain control over those cities (your most important asset, of course). #Since Mobile Militia are tightly restricted to city perimeters, this prevents them from wandering from one city to another. They can't roam to cities you haven't conquered yet, and stops them from cleaning up enemy resistance around those cities (making the rest of the game way too easy). In other words, Mobile Militia trained in Drassen would roam only around Drassen, instead of wandering off to Alma and cleaning out enemy patrols there. The XML certainly improved our control over Mobile Militia, making them much more useful for providing extra defense for your cities. The Problem With Static Restrictions For all its good, the Static Restrictions system outlined above is somewhat flawed. The most important flaw is that restricting militia to tight City-Perimeters patrols means that they can't secure the roads leading away from the city. In addition, they can't provide optimal protection for SAM sites or other important strategic areas (such as San Mona or Tixa). While the player can alter the XML to allow Militia Roaming into those "strategic" areas, this often results in Militia "spilling over" from those sectors into the perimeter of a yet-unconquered city. This results again in Mobile Militia roaming all over the map on their own, and eliminating enemy resistance as they go. HAM & Mobile Militia - Overview : Main article: Mobile Militia Since its earliest days, HAM strived to make some radical changes to the way Mobile Militia are trained, how they are used, and how they move across the map. In fact, one of the first HAM features dealt directly with Mobile Militia movement, trying to come up with a better "Restrictions" system that does away with the flaws of the static system outlined above. The idea was to keep Mobile Militia moving smartly, and only through the most important areas, but also to keep them from going too far. This required a system where the player's progress through the campaign has a direct influence on where Militia can and cannot go. That is: the more you've progressed in the game, the further your Mobiles can go. By HAM 3.4, no less than THREE separate systems were devised for this purpose! *The first solution presented by HAM was to allow Mobile Militia to travel into any sectors which have previously been explored by your Mercenaries. The further your mercs travelled across the map, the further Mobile Militia could travel. *The second solution was a set of restrictions that kept changing, each time the player conquered a city on the map. In other words, Militia Movement was restricted based directly on which cities you've liberated, and would constantly change as you won/lost control of more cities. This was a leap forward in Mobile Militia management, as it allows Militia to roam into strategically-important areas without "spilling over" and wandering off towards Meduna. *The third solution, which came much later, externalized the above system into a new XML file. This combined the New with the Old, and made sense strategically as well as allowed players to change the way it worked as they see fit! HAM 1 - Exploration-Based Restrictions HAM's first solution to the Roaming Militia problem was to combine the "old and static" Restrictions XML with a system that allowed Militia to roam into areas previously explored by the player's Mercs. In this system, Militia are restricted based on RestrictedRoamingMilitia.XML, just like in "vanilla" 1.13. This means that they are generally confined to the perimeter of cities, and cannot leave that perimeter on their own. However, whenever a sector was explored by your mercs (that is, visited at least once), Militia were henceforth allowed to roam there whenever they wanted to. The end result is that for the most part, Mobile Militia move to protect your cities, but you can enhance their area-of-coverage by exploring more sectors on the map. They can patrol sectors you've already visited or attacked, and so they never roam too far or clean out areas that your mercs haven't had a chance to explore yet. Benefits The benefit of this system should be obvious: It allows the area patrolled by Militia to grow along with your progress. The more you explore, the more your Mobile Militia can move about. If you want Militia to roam into a specific sector which is normally disallowed by the Restrictions XML, all you have to do is to visit that sector once with your mercs. For instance, explore the area around a SAM site, and your Militia can move there to patrol it, even if it was previously restricted to them. If you "explore" the road between two cities, this allows Militia to move from one city to another. If one of these is an enemy city, then the Mobiles can swoop in along the road and help you clean out enemies around that city (they might even do it on their own without your mercs' help). Caveats This method is not without flaws of course. The biggest problem is that the player needs to be careful about exploring too much of the map - because this allows Militia to randomly roam into areas where they are not really needed. If you explore too much, your defenses may end up spreading too thin. Also, this system still allows exploiting Militia for cleaning out the area around yet-unconquered cities, which has the potential of reducing player involvement in the strategic game to a minimum. This is not a desirable outcome, as far as HAM is concerned. HAM 1 - Conquest-Based Restrictions (Hard-coded) The second solution to the Militia Movement problem is to change the restrictions based on which cities were liberated by the player. These are called "Conquest-Based Restrictions". Here's the jist of it: When you liberate a city, the restrictions are changed to allow Militia to roam around that city's perimeter, and also to control strategically-important sectors nearby. That includes the roads leading towards the city, areas protecting a nearby SAM site, and crossroads connecting the city to other areas of the map. The sectors around enemy-controlled cities, as well as non-important sectors, remain blocked off to Militia. In other words, if you control only one city, then Mobile Militia can only roam in the strategic areas nearby to that one city. This allows them to protect your assets and patrol some roads, but does not allow them to move further afield and tackle enemies in "hostile" territory. As more cities are liberated, the area around those cities also becomes unrestricted. If two conquered cities are close to each other, the game automatically opens the roads to travel between those two cities. Militia can now protect both of them, as well as all nearby assets, giving a far more sensible and beneficial defense. In fact, in some cases, controlling two cities can actually "unlock" a new roaming area that was previously denied. For instance, with both Alma and Cambria conquered, Militia are allowed to roam all the way around the Cambria SAM Site, improving their ability to protect it from enemy attack. Controlling Cambria alone only provides partial defense for the SAM site. It should be fairly obvious that this system fulfills all the criterions: *It allows Militia to defend your most important assets, like cities, roads and SAM sites. *It completely prevents Militia from roaming into areas that have no strategic value. *It prevents Militia from going into areas that clearly belong to the enemy. *Militia can eventually move between ALL your liberated cities, and even reach Meduna, but only gain that ability as you make solid progress in the game. Why is this called "Hard-Coded"? Of course, someone has to decide which cities unlock which sectors for roaming. When this feature was developed, during HAM 1, Headrock decided what he thought was best and coded a set of rules right into the game. This meant that players had to trust that set of rules to "unlock" the correct sectors with the right city. However, as with all other HAM features, there was always the desire to allow players to change the rules and decide for themselves which sectors are "unlocked" when. This was eventually accomplished in HAM 3.4 (see below). HAM 3.4 - Conquest-Based Restrictions (XMLized) The segment above explained how "Conquest-Based Restrictions" came to be created, and why they make such a good Roaming Restriction system. However, the original system was hard-coded, meaning that the rules governing which sectors were unlocked at which point in the game were all coded into the EXE. Players couldn't change the rules, and had to accept Mobile Militia behavior as set by Headrock. While this works just fine for JA2, it makes the system somewhat incompatible with campaign mods like WildFire and Urban Chaos. In addition, HAM strives to allow players as much freedom as possible with all of its features. HAM 3.4 saw a major improvement to the Conquest-Based system. It finally allowed players to decide for themselves: which city "unlocks" which sectors for roaming. The new system is based around a single file called DynamicRestrictions.XML, which normally resides in the folder (DataFolder)\TableData\Map\. When the Dynamic system is activated, this file effectively replaces Kaiden's RestrictedRoamingMilitia.XML. The new XML has a simple structure, detailing each sector and the conditions required to unlock it for roaming. The file can even be updated without restarting your campaign: Save, Quit, Reload, and your changes will immediately take effect. Structure of DynamicRestrictions.XML The Dynamic Restrictions file is very simple to read and edit. It lists all sectors that can be "unlocked" for Mobile Militia Roaming, and the conditions required to unlock that sector. A "condition" refers simply to a city that needs to be liberated. You can list more than one city, thereby requiring all those cities to be liberated first. A city's number can be gleaned by looking at the file (DataFolder)\TableData\Map\Cities.XML. It contains all cities in the game, their numbers, and the sectors that they occupy. Different campaign mods may number their cities differently, so make sure you examine Cities.XML before continuing. DynamicRestrictions.XMLs supplied with HAM 3.4 HAM 3.4 (and later versions) comes pre-packaged with several versions of DynamicRestrictions.XML. Each of these files contains a different set of restriction rules, which will radically change the way that Mobile Militia move around the map. You can choose the file you like the most! The idea behind this is to show the capabilities of DynamicRestrictions.XML, and also to render the old RestrictedRoamingMilitia.XML entirely obsolete. (For instructions on how to install any of these, read below) Installing your favourite DynamicRestrictions file To install any of the files above, follow this procedure: #Backup your original file for later use. The file to backup is (DataFolder)\TableData\Map\DynamicRestrictions.XML. You can rename it "DynamicRestrictions.BAK", for simplicity. #Extract your chosen XML file from the HAM package to your (DataFolder)\TableData\Map folder. #Rename the new file to "DynamicRestrictions.XML". If you've installed HAM without performing the above, the game will use the fully-dynamic set by default. Combining Exploration and Conquest Restrictions The two restriction types allowed by HAM can be turned on and off independently of one another. You can also turn both of them on, if you wish. There are a few possible advantages to using both systems together. In this way you've got a basic dynamic restriction style, but can explore the map to expand the Militia roaming area. Please note that Exploration rules override Conquest rules - an explored sector is ALWAYS allowed for militia roaming, even if the Conquest conditions have not yet been met. INI Settings There are three important INI settings for the Dynamic Restrictions system. RESTRICT_ROAMING ALLOW_RESTRICTED_MILITIA_THROUGH_VISITED_SECTORS ALLOW_DYNAMIC_RESTRICTED_ROAMING See Also Mobile Militia Movement in Cities and SAM sites External Links Shockwave (SWF) Presentation on how the System Works. : Category:Features Category:HAM Militia